<template>
  <el-form ref="CoreTaskDetail" :model="info" label-width="150px">
    <el-row>
      <el-col :span="24">
        <el-form-item label="任务图片" style="margin-top:15px;">
          <img v-if="info.doImgList" style="width:120px; height:120px;" :src="info.doImgList">
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="8">
        <el-form-item label="id：" prop="id">
          {{info.id}}
        </el-form-item>
         <el-form-item label="任务名称：" prop="maintainId">
          {{ getDictDataLabel(DICT_TYPE.FI_PROJECT_FEEDBACK_TYPE, info.maintainId) }}
        </el-form-item>
        <el-form-item label="项目名称：" prop="projectName">
          {{ info.projectName}}
        </el-form-item>
        <el-form-item label="任务状态：" prop="isFinish">
          <span>{{ getDictDataLabel(DICT_TYPE.FI_CORE_TASK_STATUS, info.isFinish) }}</span>
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="完成时间：" prop="finishTime">
          <span>{{ parseTime(info.finishTime) }}</span>
        </el-form-item>
        <el-form-item label="完成地点：" prop="currentLocation">
          {{info.currentLocation}}
        </el-form-item>
        <el-form-item label="完成人：" prop="doTaskUid">
          <span>{{ info.doTaskName }}</span>
        </el-form-item>
        <el-form-item label="任务描述：" prop="doTaskDesc">
          <span>{{ info.doTaskDesc }}</span>
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="截止时间：" prop="endTime">
          <span>{{ parseTime(info.endTime) }}</span>
        </el-form-item>
        <el-form-item label="创建人：" prop="creator">
          {{info.creator}}
        </el-form-item>
        <el-form-item label="创建时间：" prop="createTime">
          <span>{{ parseTime(info.createTime) }}</span>
        </el-form-item>
        <el-form-item label="更新时间：" prop="updateTime">
          <span>{{ parseTime(info.updateTime) }}</span>
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
</template>
<script>
import { getDictDataLabel, getDictDatas, DICT_TYPE } from '@/utils/dict';
import { get } from "@/api/fi/coreTask/";
export default {
  name: "CoreTaskDetail",
  created(){
    const taskId = this.$route.params && this.$route.params.taskId;
    this.getTaskObj(taskId);
  },
  data() {
    return {
      info : {}
    };
  },
  methods : {
    getTaskObj(id){
      get(id).then(response => {
        this.info = response.data;
      });
    }
  }
};
</script>
